package com.dream.service.recommender.splitter.strage;

import com.dream.service.recommender.domain.enums.UserType;
import com.dream.service.recommender.domain.splitter.enums.StrategyType;
import com.dream.service.recommender.splitter.strage.impl.RandomStrategy;
import com.dream.service.recommender.splitter.strage.impl.RoundStrategy;
import com.dream.service.recommender.splitter.strage.impl.UserStrategy;

/**
 * Created by zhiji on 2016/3/15.
 */
public class StrategyFactory {

    public static Strategy getStrager(StrategyType strategyType) {
        switch (strategyType) {
            case RANDOM:
                return new RandomStrategy();
            case ROUND:
                return new RoundStrategy();
            case PARTITIONBYPIN:
                return new UserStrategy(UserType.PIN);
            case PARTITIONBYUUID:
                return new UserStrategy(UserType.UUID);
            case PARTITIONBYDEVID:
                return new UserStrategy(UserType.DEVICEID);
            default:
                return new RandomStrategy();
        }
    }
}
